﻿@using VocaDb.Web.Helpers
@using rule = VocaDb.Model.Service.QueryableExtenders.EventSortRule;
@using Res = ViewRes.Event.EventsBySeriesStrings
@inherits VocaDb.Web.Code.VocaDbPage<VocaDb.Model.DataContracts.ReleaseEvents.ReleaseEventForApiContract[]>

@{
	PageProperties.Title = ViewRes.SharedStrings.ReleaseEvents;
}

@helper SortDirection(rule rule) {
	if (ViewBag.SortRule == rule) {
		<span class="sortDirection_down"></span>
	}
}

@section Toolbar {	
	
	<ul class="nav nav-pills">
		<li class="active">
			@Html.ActionLink(Res.ViewList, "Index")
		</li>
		<li>
			@Html.ActionLink(Res.ViewBySeries, "EventsBySeries")
		</li>
		<li>
			@Html.ActionLink(Res.ViewByDate, "EventsByDate")
		</li>
	</ul>

	@if (Login.CanManageDb) {
		@Html.ActionLink(Res.CreateEvent, "Edit", null, new { id = "createEventLink" })
		@:
		@Html.ActionLink(Res.CreateSeries, "EditSeries", null, new { id = "createSeriesLink" })
	}
}

@Helpers.EventThumbs(Model)

@section BodyScripts {
	<script type="text/javascript">
		$(function () {
			$("#createSeriesLink").button({ icons: { primary: 'ui-icon-plus' } });
			$("#createEventLink").button({ icons: { primary: 'ui-icon-plus' } });
		});
	</script>
}